package gp;

import java.util.List;

import firing.FiringTree;



public class RouletteWheelSelection implements SelectionStrategy, IndexSelectionStrategy {

    
    
    public int getIndex(int populationSize) {
	return (int)(Math.pow(Math.random(),2) * populationSize);
    }

    @Override
    public List<FiringTree> getNextGen(List<FiringTree> prevGen) {
	return Generationator.getNextGen(prevGen, this);
    }
    
    public String toString() {
	return "Roulette Wheel";
    }
}
